<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>函数调用栈</title>
</head>
<body>
<script>
  var color = 'blue';
  window.a = 20
    function changeColor() {
      var anotherColor = 'red';

      function swapColors() {
        var tempColor = anotherColor;
        anotherColor = color;
        color = tempColor;
      }

      swapColors();
    }

    changeColor();
</script>
</body>
</html>